package com.tanhua.dubbo.api.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.ReportApi;
import com.tanhua.dubbo.mapper.ReportMapper;
import com.tanhua.dubbo.pojo.Questionnaire;
import com.tanhua.dubbo.pojo.Report;
import com.tanhua.dubbo.pojo.SoulQuestion;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@DubboService(version = "1.0.0")
public class ReportApiImpl implements ReportApi {
    @Autowired
    private ReportMapper reportMapper;
    @Override
    public Report queryByReportId(Long id) {
        return this.reportMapper.selectById(id);
    }

    @Override
    public List<Report> queryReportList(Long questionnaireId) {
        QueryWrapper<Report> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("questionnaire_id",questionnaireId);
        return this.reportMapper.selectList(queryWrapper);
    }
}
